﻿using Furion.CMS.Core.Base;
using Furion.DatabaseAccessor;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Furion.CMS.Core
{
    /// <summary>
    /// 只读应用服务
    /// </summary>
    /// <typeparam name="TEntity">数据表映射实体</typeparam>
    /// <typeparam name="TListDto">列表数据传输对象</typeparam>
    /// <typeparam name="TDetailDto">详情数据传输对象</typeparam>
    /// <typeparam name="TFilterParams">数据过滤参数</typeparam>
    /// <typeparam name="TSortParams">排序参数</typeparam>
    public interface IReadOnlyAppService<TEntity, TListDto, TDetailDto, TFilterParams, TSortParams>
        where TEntity : class, IPrivateEntity, new()
        where TListDto : class, new()
        where TDetailDto : class, new()
        where TFilterParams : BaseFilterParams<TEntity>, new()
        where TSortParams : BaseSortParams, new()
    {
        /// <summary>
        /// 获取分页列表
        /// </summary>
        /// <param name="index"></param>
        /// <param name="limit"></param>
        /// <param name="filter"></param>
        /// <param name="sort"></param>
        /// <returns></returns>
        PagingList<TListDto> GetPagedList(int index, int limit, [FromQuery] TFilterParams filter, [FromBody] TSortParams sort = default);
    }
}
